using BaseGrpcEFCore.Extensions;
using BaseGrpcServer.Extensions;
using Nacos.AspNetCore.V2;

var builder = WebApplication.CreateBuilder(args);

// Additional configuration is required to successfully run gRPC on macOS.
// For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682

// Add services to the container.
builder.Services.AddGrpc();
// Will regist a service instance to nacos
/// <see cref="NacosAspNetOptions">
builder.Services.AddNacosAspNet(builder.Configuration);
// Mysql dependency
builder.Services.AddMysqlDbContext(builder.Configuration);
var app = builder.Build();

// Configure the HTTP request pipeline.
app.MapAllGrpcServices();
app.Run();

/*
 
docker run --name nacos -d -p 8848:8848 -p 9848:9848 \
--privileged=true --restart=always \
-e JVM_XMS=512m -e JVM_XMX=2048m -e MODE=standalone -e PREFER_HOST_MODE=hostname \
-v /home/nacos/logs:/home/nacos/logs nacos/nacos-server

*/